var _util = require("util/util.js");

var shipping = {
	//保存收货地址
	save : function(data,resolve,reject){
		_util.request({
            url     : _util.getServerUrl('/shipping/save.do'),
            method  : 'POST',
            data	: data,
            success : resolve,
            error   : reject
        });
	},
    //删除收货地址
    delete : function(data,resolve,reject){
        _util.request({
            url     : _util.getServerUrl('/shipping/delete.do'),
            method  : 'POST',
            data    : data,
            success : resolve,
            error   : reject
        });
    },
    //收货地址列表
    list : function(data,resolve,reject){
        _util.request({
            url     : _util.getServerUrl('/shipping/list.do'),
            method  : 'POST',
            data    : data,
            success : resolve,
            error   : reject
        });
    },
    //设置默认地址
    setDefault : function(data,resolve,reject){
        _util.request({
            url     : _util.getServerUrl('/shipping/set_default.do'),
            method  : 'POST',
            data    : data,
            success : resolve,
            error   : reject
        });
    }
}

module.exports = shipping;